#pragma once
#include "MovingObject.h"
#include "Screen.h"

#define IS_STANDING 0
#define IS_MOVING_LEFT 1
#define IS_MOVING_RIGHT 2
#define IS_FLYING 3

#define DIR_LEFT 100
#define DIR_RIGHT 200

class CMario :
	public MovingObject
{

protected:
	float _maxvx;
	float _maxvy;

	bool _isMoving;
	bool _isJumping;
	bool _isStanding;

	float _lastX;
	float _lastY;

	int _lastDir;

	Sprite *_spriteStandLeft,*_spriteStandRight,*_spriteMoveLeft,*_spriteMoveRight;
	Sprite *_spriteJumpLeft,*_spriteJumpRight;

public:
	CMario(void);
	CMario(float x, float y, int Width, int Height, float vx, float vy, int deltaTime, LPD3DXSPRITE spriteHandler, LPDIRECT3DTEXTURE9 image);
	CMario(float x, float y, float vx, float vy, int deltaTime,int resourceName,CResourceManager *rm);
	~CMario(void);

	void Move();
	void Render();
	void MoveLeft();
	void MoveRight();
	void Jump();
	void fallDown();
	void Stand();
	void checkSpeed();

	RECT getRect();

	int getStatus();

	bool isMoving(){return _vx != 0;};

		bool _isMoveLeft;
	bool _isMoveRight;

};

